﻿<?php
include_once("../../includes/metodos.php");
include_once("action.php");

connectSql();
checkUser();
isAdmin();
include_once('../cabecalho.php');

if(!empty($_POST['cmd']) && $_POST['cmd']=='edit'){
	edit(anti_injection($_REQUEST['id']));	
}

$query = mysql_query("SELECT * FROM econ_categorias WHERE id=".anti_injection($_REQUEST['id']));
$row = mysql_fetch_array($query);
?>
<div>
	<form action="edit.php" method="post">
		<label>Titulo:</label>
		<input type="text" name="categoria" value="<?php echo $row['nome'];?>"/>
		<input type="hidden" name="cmd" value="edit"/>
		<input type="hidden" name="id" value="<?php echo anti_injection($_REQUEST['id']);?>"/>
		<input type="submit" value="Editar"/>
	</form>
</div>